<template>
	<div class="fans-item">
		<el-avatar
			:src="data.photo"
			style="width: 80px; height: 80px;"
		>
		</el-avatar>
		<p class="fans-item__name">
			{{data.name}}
		</p>
		<el-button
			type="primary"
			plain
			@click="following(data)"
		>
			<span>+</span>关注
		</el-button>
	</div>
</template>

<script>
	export default {
		props: {
			data: {
				type: Object
			}
		},
		methods: {
			// 原生点击事件进行派发事件
			following (data) {
				this.$emit('follow', data)
			}
		}
	}
</script>

<style lang="less" scoped>
	.fans-item{
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		border: 1px dotted #ddd;
		padding: 15px;
		box-sizing: border-box;
		margin-bottom: 15px;
		.fans-item__name{
			font-size: 14px;
			margin: 15px 0;
			box-sizing: border-box;
		}
		.el-button{
			span{
				margin-right: 2px;
			}
		}
	}
</style>
